<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<title>Halaman Unggah Video</title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
	<link href="<?php echo base_url()?>asset/css/bootstrap.css" rel="stylesheet">
    <link rel="shortcut icon" href="/favicon.ico">
	<link href="<?php echo base_url()?>asset/css/style.css" rel="stylesheet">
	<style>
	@media (min-width: 768px) {
		.buka {
			 visibility: hidden;
		}
	}
	</style>
	<script src="<?php echo base_url()?>asset/js/jquery.js"></script>
	<script src="<?php echo base_url()?>asset/js/jquery-migrate-1.2.1.min.js"></script>
	<script src="<?php echo base_url()?>asset/js/bootstrap.js"></script>
	

</head>
<body>  

	<div class="container-fluid" style="background-color:">  
		    <div class="row-fluid">  
				<div class="col-lg-12" id="header">  
					<a href="<?php echo base_url()?>index.php"><img src="<?php echo base_url()?>asset/img/logo.png" style="width: 300px; height: 120px; align:center; display: inline; margin: 0px 0 50px 20px"/></img></a>
					<h3 style="margin: -79px 0 20px 90px; font-family: Georgia; font-size: 30px"></h3> <br>
					<small style="font-family: Times New Roman; font-size: 17px; margin: -40px 0 0 90px; display: inline; position: absolute"></small>
					<span style="margin-top: -15px; margin-right:10px; font-family: tahoma; font-size:18px;" class="pull-right span3">
					
					<?php
						if(!$this->session->userdata('isLogin')) { ?>
					<button class="btn btn-primary" data-toggle="modal" data-target="#modal_login"><span class="glyphicon glyphicon-log-in"></span> Login</button>
				| <a href="<?php echo base_url()?>index.php/home/" class="btn btn-danger" role="button"><span class="glyphicon glyphicon-home"></span> Home</a>
					<?php } else { ?> <a href="<?php echo base_url()?>index.php/akun/keluar_akun" class="btn btn-danger" role="button"><span class="glyphicon glyphicon-log-out"></span> Keluar</a> <?php } ?>
					</span>
				</div>  
			</div> 
		<div class="row-fluid" >
			<div class="col-lg-12" id="navbar" >
				<form class="navbar-form navbar-right" style="margin-top:10px; margin-right:0px; margin-left:1px;" role="search" action="">
					  <div class="form-group ">
						<input type="text" class="form-control" placeholder="cari video disini...">
					  </div>
					  <button type="submit" class="btn btn-danger " ><span class="glyphicon glyphicon-search "></span></button>
				</form>
				
				
			</div>  
		</div>
		
	<div class="container-fluid">  
		<div class="row-fluid">  
		<div class="col-lg-2 " style="" id="left-content"> 
			<div class="row-fluid">  
					<?php $user = $this->session->userdata('username'); ?>
					<?php if($user != NULL):?>
					<?php if($this->session->userdata('peran')!= 0) {?>
					   <div class="col-md-12" id="sidebar-widget">
							<ul class="nav nav-list">
							  <li class="nav-header" style=""><?php echo $user; ?></li>
								<li><a href="<?php if($this->session->userdata('peran') != 1 ) {
								echo base_url();?>index.php/akun" <?php } else { echo base_url();?>index.php/admin" <?php } ?>class="glyphicon glyphicon-user">  Profilku</a></li>
								<?php if($this->session->userdata('peran') != 1 ){ ?>
								<?php if($this->session->userdata('status') == 1) { ?>
									<li  class="active"><a href="<?php echo base_url()?>index.php/video/" class="glyphicon glyphicon-upload">  Unggah</a></li> 
									<li><a href="<?php echo base_url()?>index.php/video/videoku" class="glyphicon glyphicon-film"  data-toggle="collapse" data-target=".hisCollapse" style="">  Videoku</a></li>
									<?php } else { ?>
										<li class="disabled"><a class="glyphicon glyphicon-upload">  Unggah</a></li> 
										<li class="disabled"><a class="glyphicon glyphicon-film">  Videoku</a></li> 
									<?php } ?>
								<?php } ?>
							</ul>
							<br>
						</div> 
						<?php } ?>
						<?php endif;?>
						
					<div class="col-md-12" id="sidebar-widget" style="margin-top:20px;"> 
						<ul class="nav nav-list">
						  <li class="nav-header" data-toggle="collapse" data-target=".navCollapse" style="">Kategori <span class="glyphicon glyphicon-align-justify pull-right"></span></li>
						   <ul class="nav nav-list collapse in navCollapse">
								<?php foreach($kategori as $row) {?>
									<li><a href="<?php echo base_url();?>index.php/video/cari_video_sesuai_kategori/<?php echo $row->id_kategori;?>"><?php echo $row->nama_kategori;?></a></li>  
								<?php } ?>
							</ul>
						</ul>
					</div>    
					
					<?php if(count($histori_video) > 0 ) {?>
					<div class="col-md-12" id="sidebar-widget" style="margin-top:20px;"> 
					<ul class="nav nav-list">
					  <li class="nav-header" data-toggle="collapse" data-target=".hisCollapse" style="">Histori Video<span class="glyphicon glyphicon-align-justify pull-right"></span></li>
					   <ul class="nav nav-list collapse in hisCollapse">
							<?php foreach($histori_video as $row) {?>
								<li><a href="<?php echo base_url();?>index.php/video/lihat_video/<?php echo $row->id_video;?>"><?php echo $row->judul_video;?></a></li>  
							<?php } ?>
						</ul>
						</ul>
					</div>
					<?php } ?>
					
				 </div>  
		</div>  
	   
			   	   
		<div class="col-lg-8">  
			<div class="container-fluid">
				 <!-- video terbaru -->
				<div class="col-lg-12 " style="background-color:#000sss ; margin-bottom:10px;">
			
					<blink><?php echo $berhasil; ?></blink>
				
		   <legend>Unggah Video <h6 class="pull-right" style="color:red">(*) Harus diisi!</h6></legend> 
				
			
			<form class="form-horizontal pull-left" role="form" action="<?php echo base_url()?>index.php/video/insert_video" method="post" enctype="multipart/form-data">
					  <div class="form-group col-sm-12">
						<label for="judulvideo" class="col-sm-2 control-label">Judul Video</label>
						<div class="col-sm-6">
						  <input type="text" name="judulvideo" class="form-control" id="judulvideo" placeholder="Judul Video" required>
						</div>
						<a class="col-lg-1" style="color:red">*</a>
					  </div>
					  
					
					  <div class="form-group col-sm-12">
						<label for="video" class="col-sm-2 control-label">Video</label>
						<div class="col-sm-6">
						  <input type="file" class="form-control" id="video" name="video" required>
						</div>
						<a class="col-lg-1" style="color:red">*</a>
						<div class="col-sm-3">
						  <p  class="text-success">Video harus : mp4, flv, ogg atau 3gp. Max: 10MB</p>
						</div>
					  </div>
					
					<script>
						$(function() {
								var i = 0;
								$('#addKat').click( function() {
										i++;
										$('#katDiv').append('<div class="form-group" class="col-sm-12" id="katDiv'+ i +'"><label for="kategorivideo" class="col-sm-2 control-label"> </label><div class="col-sm-6"><select class="form-control" name="kategorivideo'+ i +'"> <option>[Silahkan Pilih Kategori Lainnya]</option>  <?php foreach($nama_kategori as $row) {?> <option value="<?php echo $row->id_kategori;?>"><?php echo $row->nama_kategori;?></option><?php } ?> </select> </div> <div class="col-sm-2"><span class="btn btn-primary" id="remKat"><span class="glyphicon glyphicon-minus"></span></span><input type="hidden" name="pointer[]" value="'+ i +'"/></div></div>');
										
								});
								$('#remKat').live('click', function() {
									if(i>0) {
									$('#katDiv'+i).remove();
									}
									i--;
								});
						});
					</script>
					  
					  <div class="form-group col-sm-12" id="katDiv">
						<label for="kategorivideo" class="col-sm-2 control-label">Kategori Video</label>
						<div class="col-sm-6">
							<select class="form-control" name="kategorivideo0" required>
								<option>[Silahkan Pilih Kategori]</option>  
								<?php foreach($nama_kategori as $row) {?>
									<option value="<?php echo $row->id_kategori;?>"><?php echo $row->nama_kategori;?></option>  
								<?php } ?>
							</select>
						</div>
						
							<a class="col-lg-1" style="color:red">*</a>
					
						<div class="col-sm-2">
							<span class="btn btn-primary" id="addKat"> <span class="glyphicon glyphicon-plus"></span> Tambah kategori lainnya</span>
							<p></p>
						</div>
						
						<input type="hidden" name="pointer[]" value="0"/>
					  </div>
					  
					  
						
						
					<div class="form-group col-sm-12">
						<label for="sumbervideo" class="col-sm-2 control-label">Sumber Video</label>
						<div class="col-sm-6">
						  <input type="text" class="form-control" id="sumbervideo" name="sumbervideo" placeholder="Sumber Video" required /> 
						</div>
						<a class="col-lg-1" style="color:red">*</a>
						<div class="col-sm-3">
						  <p  class="text-success">Berasal dari event apa anda mengambil video?</p>
						</div>
					 </div>

					
					  <div class="form-group col-sm-12">
						<label for="deskripsivideo" class="col-sm-2 control-label">Deskripsi Video</label>
						<div class="col-sm-6">
						  <textarea id="datepicker" rows="3" class="form-control" name="deskripsivideo" required></textarea>
						</div>
						<a class="col-lg-1" style="color:red">*</a>
						<div class="col-sm-3">
						  <p  class="text-success">Jelaskan deksripsi tentang video.</p>
						</div>
					  </div>
					  
					  <div class="form-group col-sm-12">
						<label for="info" class="col-sm-2 control-label">Info Singkat</label>
						<div class="col-sm-6">
						  <input type="text" id="info" class="form-control" value="" name="infosingkat" placeholder="Isi dengan info singkat terkait dengan video" required>
						</div>
						<a class="col-lg-1" style="color:red">*</a>
						<div class="col-sm-3">
						  <p  class="text-success">Isilah dengan info singkat seputar video. Max : 50 huruf.</p>
						</div>
					  </div>
					  
					  <div class="form-group col-sm-12">
						<label for="gambarvideo" class="col-sm-2 control-label">Gambar Video</label>
						<div class="col-sm-6">
						  <input type="file" class="form-control" id="gambarvideo" name="gambarvideo" required>
						</div>
						<a class="col-lg-1" style="color:red">*</a>
						<div class="col-sm-3">
						  <p  class="text-success">Gambar harus : jpg, jpeg, png, atau bmp. Max : 300kb, 1024x768</p>
						</div>
					  </div>
					  
					  <div class="form-group col-sm-12">
						<div class="col-sm-offset-2 col-sm-10">
						  <button type="submit"  class="btn btn-success">Unggah</button>
						  <a href="<?php echo base_url()?>index.php/home" class="btn btn-default" role="button">Batal</a>
						</div>
					  </div>
					</form>
		</div> 
		 </div>
		</div>  
	  
			<div class="col-lg-2"  style="margin-top:10px;">
				<ul class="nav nav-list">
					<li class="nav-header" data-toggle="collapse" data-target=".navHeaderCollapse" style="">Asal Daerah <span class="glyphicon glyphicon-align-justify pull-right"></span></li>
					   <ul class="nav nav-list collapse navHeaderCollapse">
							<?php foreach($daerah as $row) {?>
								<li><a href="<?php echo base_url();?>index.php/video/cari_video_sesuai_kategori/<?php echo $row->id_kategori;?>"><?php echo $row->nama_kategori;?></a></li>  
							<?php } ?>  
						</ul>
				</ul>
			</div>
		
		
	   </div>  
	  
	  
	    <!--S : Footer-->  
	  
	   <div class="row-fluid">  
		<div class="col-lg-12" id="footer"> <p class = "footer-text"> Copyright 2014 <strong class="pull-right">{elapsed_time} || {memory_usage}</strong> </p> 
		</div>  
	   </div>  
	  
	   <!--E : Footer-->  
	  
	  </div>
	</div>
							
				<!-- modal start login akun-->
			<div class="modal fade " style="overflow:hidden; background: url(<?php echo base_url()?>asset/img/batik-madura.jpg) repeat top right;" id="modal_login" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
			  <div class="modal-dialog" >
				<div class="modal-content">
				  <div class="modal-header" style="background-color:#3399FF;">
					<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
					<b><h4 class="modal-title" id="myModalLabel" style="color:#ffffff;">Masuk <i>Culture-Vid</i></h4></b>
				  </div>
				  <div class="modal-body" >
					<form class="form-horizontal" role="form" action="<?php echo base_url()?>index.php/akun/login" method="post">
					  <div class="form-group">
						<div class="col-sm-8">
						  <input type="text" name="hidden" class="form-control hidden" id="hidden" value="daftar">
						</div>
					  </div>
					  
					  <div class="form-group">
						<label for="namaakun" class="col-md-3 control-label">Nama Akun</label>
						<div class="col-sm-8">
						  <input type="text" name="username" class="form-control " id="namaakun" placeholder="Nama Akun Anda">
						</div>
					  </div>
					  <div class="form-group">
						<label for="inputPassword3" class="col-md-3 control-label">Kata Kunci</label>
						<div class="col-sm-8">
						  <input type="password" class="form-control" id="katakunci" name="password" placeholder="Kata Kunci">
						</div>
					  </div> 
					  <div class="form-group">
						<div class="col-sm-offset-2 col-sm-10">
						  <div class="checkbox">
							<label  style="margin-right:50px;">
							  <input type="checkbox"> Ingat Akun
							</label>
							<span class="glyphicon glyphicon-question-sign"></span>
							<a href="<?php echo base_url()?>/akun/lupa_pass">Lupa Kata Kunci Anda</a>
						  </div>
						</div>
					  </div>
					  <div class="form-group">
						<div class="col-sm-offset-2 col-sm-10">
						  <button type="submit" class="btn btn-success">Masuk</button>
						  <button type="button" class="btn btn-default" data-dismiss="modal">Batal</button>
						</div>
					  </div>
					</form>
				  </div>
				</div><!-- /.modal-content -->
			  </div><!-- /.modal-dialog -->
			</div><!-- /.modal -->
		
			<!-- modal end login akun-->
	
								
	
    <!-- Le javascript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
	
	
</body>
</html>